/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-07-30
 * Time: 14:51
 * To BE A Better Person-2020-3-2
 */
//有三个线程，线程名称分别为：a，b，c。
//每个线程打印自己的名称。
//需要让他们同时启动，并按 c，b，a的顺序打印
public class TestDemo {
    public static final Object locker1=new Object();

    public static void main(String[] args) throws InterruptedException {
        Thread a=new Thread(()->{
            synchronized (locker1){
                try {
                    locker1.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("a");

            }

        });
        //hhh
        Thread b=new Thread(()->{

            synchronized (locker1){
                System.out.println("b");
                locker1.notify();
            }

        });
        Thread c=new Thread(()->{
            System.out.println("c");


        });
        //hhh
        b.join();
        a.join();
        a.start();
        b.start();
        c.start();


    }


}
